package dream

import (
	"fmt"
	"sync"
)

type XY int16

type IRun interface {
	Run(wg *sync.WaitGroup)
}
type IStop interface {
	Stop()
}

var workPath string

func init() {
	workPath = GetCurrentPath()
	//workPath, _ = os.Getwd()
	fmt.Println("WorkPath:", workPath)
}

func SetWorkPath(s string) {
	workPath = s
	fmt.Println("WorkPath:", workPath)
}

func GetWorkPath() string {
	return workPath
}

func Assert(cond bool, format string, a ...interface{}) {
	if !cond {
		fmt.Println("--- --- Assertion Failed --- --- ---")
		if a == nil || len(a) == 0 {
			panic(format)
		} else {
			panic(fmt.Sprintf(format, a...))
		}
	}
}

func AssertImposible(cond bool, format string, a ...interface{}) {
	Assert(!cond, format, a...)
}
